# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-colored
pkgname=('python2-colored' 'python-colored')
_pkgname=colored
pkgver=2.3.0
pkgrel=1
pkgdesc='Simple library for color and formatting to terminal.'
arch=('any')
url='https://pypi.org/project/colored/#files'
makedepends=('python2-setuptools' 'python-setuptools')
license=('MIT')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('e5c797f3c6e4fc0648728c776388dbfc156b21c4c56c978fc7dac2478811b6090b40a8c1863b78b0c0cbdfbed372c9d3ad86d96e7bc3db930353dbb98fde8f80')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-colored() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-colored() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

